import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import typescript from '@rollup/plugin-typescript'

export default [
	{
		input: 'packages/vue/src/index.ts',
		output: [
			// 导出iife格式
			{
				// 开启sourceMap
				sourcemap: true,
				// 导出文件地址
				file: 'packages/vue/dist/vue.js',
				// 导出格式
				format: 'iife',
				// 模块名称
				name: 'Vue',
			}
		],
		// 插件
		plugins: [
			// ts
			typescript({
				sourceMap: true,
			}),
			// 模块导入路径补全
			resolve(),
			// 转换commonjs模块为esm
			commonjs(),
		]
	}
]